local AboutLayer = {}

AboutLayer.m_PanelAbout = nil
 
function AboutLayer.show( widget )
    AboutLayer:init( widget )
end

function AboutLayer:closeWindow() 
    self.m_PanelAbout:setLocalZOrder(-1)
    self.m_PanelAbout:setVisible(false)
end


function AboutLayer:init( widget )
    print("============AboutLayer:init============")
    
    self.m_PanelAbout = ccui.Helper:seekWidgetByName(widget.m_Json,"PanelAbout")
    self.m_PanelAbout:setPositionX(0)
    self.m_PanelAbout:setPositionY(0) 
    self.m_PanelAbout:setVisible(true)
    self.m_PanelAbout:setLocalZOrder(5)
    
    self.m_BtnBack = ccui.Helper:seekWidgetByName(self.m_PanelAbout,"BtnBack")
    self.m_BtnBack:setTouchEnabled(true)
    self.m_BtnBack:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
 
    self.m_BtnSound = ccui.Helper:seekWidgetByName(self.m_PanelAbout,"BtnSound")
    self.m_BtnSound:setTouchEnabled(true)
    self.m_BtnSound:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
end


function AboutLayer:onMenutClick(sender,eventType)
    if eventType == ccui.TouchEventType.ended then
        if sender == self.m_BtnSound then     
            print "=========AboutLayer:onMenutClick m_BtnSound======================="
        elseif sender == self.m_BtnBack then     
            print "=========AboutLayer:onMenutClick m_BtnBack======================="
            self:closeWindow()
        end
    end
end
 
return AboutLayer